package org.paradigmshift.timelapse.ui

import scala.swing.ScrollPane
import javax.swing.BorderFactory
import javax.swing.JScrollPane
import scala.swing.Table
import javax.swing.JTable
import javax.swing.JComponent
import java.awt.Graphics
import scala.swing.event.MouseClicked

class TimeLapseTableScrollPane( table: Table ) extends ScrollPane( table ) {
  
  peer.setViewport( new StripedJViewport( table.peer ) );
  peer.setViewportView( table.peer )
  peer.getViewport().setView( table.peer )
  peer.setCorner( "UPPER_RIGHT_CORNER", new JComponent() {
    override protected def paintComponent( g: Graphics ): Unit = {
      BetterJTable.paintHeader( g, table.peer, 0, getWidth() );
    }
  })
  table.peer.setPreferredScrollableViewportSize( peer.getSize() )
}